package com.ruoyi.crm.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.crm.mapper.ProjectMilepostMapper;
import com.ruoyi.crm.domain.ProjectMilepost;
import com.ruoyi.crm.service.IProjectMilepostService;

/**
 * 项目里程碑Service业务层处理
 *
 * @author ruoyi
 * @date 2021-08-30
 */
@Service
public class ProjectMilepostServiceImpl implements IProjectMilepostService
{
    @Autowired
    private ProjectMilepostMapper projectMilepostMapper;

    /**
     * 查询项目里程碑
     *
     * @param id 项目里程碑主键
     * @return 项目里程碑
     */
    @Override
    public ProjectMilepost selectProjectMilepostById(String id)
    {
        return projectMilepostMapper.selectProjectMilepostById(id);
    }

    /**
     * 查询项目里程碑列表
     *
     * @param projectMilepost 项目里程碑
     * @return 项目里程碑
     */
    @Override
    public List<ProjectMilepost> selectProjectMilepostList(ProjectMilepost projectMilepost)
    {
        return projectMilepostMapper.selectProjectMilepostList(projectMilepost);
    }

    /**
     * 新增项目里程碑
     *
     * @param projectMilepost 项目里程碑
     * @return 结果
     */
    @Override
    public int insertProjectMilepost(ProjectMilepost projectMilepost)
    {
        return projectMilepostMapper.insertProjectMilepost(projectMilepost);
    }

    /**
     * 修改项目里程碑
     *
     * @param projectMilepost 项目里程碑
     * @return 结果
     */
    @Override
    public int updateProjectMilepost(ProjectMilepost projectMilepost)
    {
        projectMilepost.setUpdateTime(DateUtils.getNowDate());
        return projectMilepostMapper.updateProjectMilepost(projectMilepost);
    }

    /**
     * 批量删除项目里程碑
     *
     * @param ids 需要删除的项目里程碑主键
     * @return 结果
     */
    @Override
    public int deleteProjectMilepostByIds(String[] ids)
    {
        return projectMilepostMapper.deleteProjectMilepostByIds(ids);
    }

    /**
     * 删除项目里程碑信息
     *
     * @param id 项目里程碑主键
     * @return 结果
     */
    @Override
    public int deleteProjectMilepostById(String id)
    {
        return projectMilepostMapper.deleteProjectMilepostById(id);
    }
}